home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / 93win / data1.cab / CSUB / CSUB_Example / CSUBW.H next >
Encoding:
C/C++ Source or Header  |  2005-03-02  |  3.5 KB  |  82 lines

  1. /* CSUBW.H -- HTBasic Windows CSUB C Language Include File Revision 8.0 */
  2. /* (c) Copyright 1989-2000 TransEra Corp. All Rights Reserved */
  3.  
  4. #define MX_STLEN 32767          /* maximum string length */
  5. #define MX_SUBS  6              /* maximum number of subscripts */
  6.  
  7. typedef unsigned char U_CHAR;
  8. typedef unsigned short int U_SHORT;
  9. typedef unsigned long U_LONG;
  10.  
  11. typedef short int T_SUBS;       /* subscript value */
  12.  
  13. typedef struct subs             /* SUBSCRIPT BOUNDS DATA */
  14. {
  15.   T_SUBS  base;                 /* subscript lower bound value */
  16.   T_SUBS  size;                 /* number of elements */
  17. }   SUBS;
  18.  
  19. typedef struct dim              /* DIMENSION TABLE ENTRY */
  20. {
  21.   U_LONG  elen;                 /* Element LENgth (string max len) (bytes) */
  22.   U_LONG  tae;                  /* Total Allocated Elements (upper byte nod) */
  23.   U_LONG  cae;                  /* Current Allocated Elements */
  24.   SUBS sbs[MX_SUBS];            /* Subscript Bounds */
  25. }   DIM;
  26.  
  27. /* The upper byte of dim.tae is used to store the number of dimensions */
  28.  
  29. #define NOD(d) (((d)->tae >> 24) &0xFF)         /* number of dimensions */
  30. #define TAE(d) ( (d)->tae & 0x00FFFFFF )        /* total array elements */
  31.  
  32. typedef short int T_INT;        /* BASIC INTEGER value */
  33. typedef double    T_FLT;        /* BASIC REAL value */
  34.  
  35. typedef struct t_cpx            /* BASIC COMPLEX value */
  36. {
  37.   T_FLT r;                      /* real part */
  38.   T_FLT i;                      /*imaginary part */
  39. }   T_CPX;
  40.  
  41. typedef struct t_str            /* BASIC STRING Data */
  42. {
  43.   T_SUBS clen;                  /* current string length */
  44.   U_CHAR str[MX_STLEN];         /* string data */
  45. }   T_STR;
  46.  
  47. typedef DIM    *dimptr;         /* pointer to Dimension Structure */
  48. typedef T_INT  *intptr;         /* pointer to INTEGER Value */
  49. typedef T_FLT  *realptr;        /* pointer to REAL Value */
  50. typedef T_CPX  *cpxptr;         /* pointer to COMPLEX Value */
  51. typedef T_STR  *strptr;         /* pointer to String Structure */
  52.  
  53. __declspec(dllexport) void *(*_fnd_com)();      /* COM memory finder */
  54. #define com_var(n,v,p)  (*_fnd_com)( (char *)(n), (int)(v), (int)(p) )
  55.  
  56. /* CSUB Jump Table Definition */
  57.  
  58. __declspec(dllexport) int (** _cjmptbl)();      /* ptr to csub jump table */
  59.  
  60. #define CSB_VER  ((long)_cjmptbl[ 0])
  61.  
  62. #define kbdcrt_check() if( CSB_VER < 16 ) return( 2009 )
  63.  
  64. /* Keyboard and Display Routines */
  65.  
  66. #define kbdcrt_clear_screen           (*_cjmptbl[ 2])
  67. #define kbdcrt_controlcrt(r,v)        (*_cjmptbl[ 3])((int)(r),(int)(v))
  68. #define kbdcrt_controlkbd(r,v)        (*_cjmptbl[ 4])((int)(r),(int)(v))
  69. #define kbdcrt_crtreadstr(b,m,l)      (*_cjmptbl[ 5])((char*)(b),(int)(m),(int*)(l))
  70. #define kbdcrt_crtscroll(f,l,d)       (*_cjmptbl[ 6])((int)(f),(int)(l),(int)(d))
  71. #define kbdcrt_cursor(c,l,t)          (*_cjmptbl[ 7])((int)(c),(int)(l),(int)(t))
  72. #define kbdcrt_dispstr(c,l,b,s,a)     (*_cjmptbl[ 8])((int)(c),(int)(l),(char *)(b),(int)(s),(int)(a))
  73. #define kbdcrt_printstr(b,l)          (*_cjmptbl[ 9])((char*)(b),(int)(l))
  74. #define kbdcrt_readkbd(b,m,l)         (*_cjmptbl[10])((char*)(b),(int)(m),(int*)(l))
  75. #define kbdcrt_scrolldn               (*_cjmptbl[11])
  76. #define kbdcrt_scrollup               (*_cjmptbl[12])
  77. #define kbdcrt_statuscrt(r,v)         (*_cjmptbl[13])((int)(r),(int*)(v))
  78. #define kbdcrt_statuskbd(r,v)         (*_cjmptbl[14])((int)(r),(int*)(v))
  79. #define kbdcrt_systemd(a,b,m,l)       (*_cjmptbl[15])((char*)(a),(int)(b),(int)(m),(int*)(l))
  80.  
  81. /* end of CSUBW.H */
  82.